import  originData from "./articleData.json";
const allData = originData.map(item=>{
  return {
    id: item['序号'],
    title: item['标题'],
    img: item['封面图片'],
    time: item['发表时间'],
    url: item['链接'],
    authorId: item['作者序号'],
    authorName: item['作者姓名'],
  }
})

export function getArticleList(params){
 const authorId = params?.authorId
 let articleList = allData;
 if(authorId){
  articleList = articleList.filter(item=>item.authorId===authorId)
 }

 return articleList;
}

